package com.kawa.kemanage.mapper;

import com.kawa.kemanage.entity.Advertiser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AdvertiserMapper {
    List<Advertiser> findAll();
    
    List<Advertiser> findByPage(@Param("offset") int offset, @Param("size") int size);
    
    long count();
    
    Advertiser findById(@Param("advertiserId") Integer advertiserId);
    
    int insert(Advertiser advertiser);
    
    int update(Advertiser advertiser);
    
    int delete(@Param("advertiserId") Integer advertiserId);
    
    boolean existsById(@Param("advertiserId") Integer advertiserId);
    
    boolean existsByCompanyName(@Param("companyName") String companyName);
    
    boolean existsByCompanyNameAndIdNot(@Param("companyName") String companyName, @Param("advertiserId") Integer advertiserId);
} 